/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package simplemetrosystem.view.canvas.MouseHandlers;

/**
 *
 * @author Eric Qian
 */
public class MouseTrans {

    /**
     * 
     * @param matrixSize
     */
    public static void NewInstance(int matrixSize) {
        trans = new MouseTrans(matrixSize);
    }

    /**
     * 
     * @param x
     * @return
     */
    public static int X(int x) {
        return trans.getX(x);
    }

    /**
     * 
     * @param y
     * @return
     */
    public static int Y(int y) {
        return trans.getY(y);
    }
    
    /**
     * 
     * @param matrixSize
     */
    private MouseTrans(int matrixSize) {
        this.matrixSize = matrixSize;
    }
    
    /**
     * 
     * @param x
     * @return
     */
    private int getX(int x) {
        return x / matrixSize;
    }
    
    /**
     * 
     * @param y
     * @return
     */
    private int getY(int y) {
        return y / matrixSize;
    }
    private static MouseTrans trans;
    private int matrixSize;
}
